import {createRouter, createWebHistory} from 'vue-router'
import Home from '@/views/Home.vue'

const routes = [
    {
        path: '/login',
        name: 'Login',
        component: () => import(/* webpackChunkName: "login" */ '@/views/login.vue')
    },
    {
        path: '/',
        name: 'Home',
        component: Home,
        children:[
            {
                path: 'role',
                name: 'Role',
                component: () => import(/* webpackChunkName: "login" */ '@/views/system/role/index.vue')
            },{
                path: 'menu',
                name: 'Menu',
                component: () => import(/* webpackChunkName: "login" */ '@/views/system/menu/index.vue')
            },{
                path: 'component/type',
                name: 'ComponentType',
                component: () => import(/* webpackChunkName: "login" */ '@/views/component/componentType.vue')
            }
        ]
    },
    {
        path: '/editor',
        // path: '/editor',
        name: 'DatavEditor',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '@/views/DatavEditor')
    }
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
